/*
*Copyright (c) Nikhil Jain.
*Project ICARUS, communications and 
*artificial intelligence.
*/



/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
 */
package javadrone.command;

//~--- JDK imports ------------------------------------------------------------

import java.util.concurrent.TimeUnit;

/**
 *
 * @author Nikzzay
 */
public abstract class AsynchronousCommand extends SynchronousCommand implements ImmediateCommand {
    private Priority cmdPriority;

    public AsynchronousCommand(Priority cmdPriority) {
        super(-cmdPriority.ordinal(), TimeUnit.MILLISECONDS);
        this.cmdPriority = cmdPriority;
    }

    protected AsynchronousCommand(long delay, Priority cmdPriority) {
        super(delay - cmdPriority.ordinal(), TimeUnit.MILLISECONDS);
        this.cmdPriority = cmdPriority;
    }

    public int compareTo(AsynchronousCommand AC) {
        return cmdPriority.compareTo(AC.cmdPriority);
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
